using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace G15_Agent.Models.Mapping
{
    public class LoaiNCCMap : EntityTypeConfiguration<LoaiNCC>
    {
        public LoaiNCCMap()
        {
            // Primary Key
            this.HasKey(t => t.MaLoai);

            // Properties
            this.Property(t => t.MaLoai)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.TenLoai)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("LoaiNCC");
            this.Property(t => t.MaLoai).HasColumnName("MaLoai");
            this.Property(t => t.TenLoai).HasColumnName("TenLoai");
        }
    }
}
